<?php
/**
 * 商户相关
 */
namespace Api\Controller;
use Common\Model\BusinessModel;
use Common\Model\UserModel;
use Common\Model\UtilsModel;
use Think\Controller;
class BusinessController extends Controller {
    const SUCCESS   =0;//成功
    const FAILURE   =1;//失败
    public function index(){
        $this->show('星悦，公共支持','utf-8');
    }


    /**
     * 取全部门店列表
     * Author: shijy
     */
    public function getStoreList(){
        $this->ajaxReturn(BusinessModel::getStoreListByRestaurantId(0));
    }

    /**
     * 获取商家对应的门店信息
     * Author: hongls
     * get 方式传递，id,商会编号
     * return id 门店id name 门店名称 address 门店地址
     */
    public function getStoreListByRestaurantId(){
        $restaurantId = I('get.id',0,'intval');
        $partner = I('get.partner',0,'intval');//0,不限，1是，2否
        $this->ajaxReturn(BusinessModel::getStoreListByRestaurantId($restaurantId,$partner));

    }

    public function getTradeAreaByDistrict(){
        $areaId = I('post.id',0,'intval');
        $data=UtilsModel::getTradeAreaKV($areaId);
        
        $this->ajaxReturn($data);
    }



}